Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uhyve: don't panic on initial unmap if page is not mapped #1508

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

jounathaen
Copy link
Member

I'm reworking the initial page mapping of uhyve to resolve hermit-os/uhyve#426, but the kernel currently expects the first GiB to be mapped and panics otherwise.
In a transition phase, it makes sense to at least not panic if the page is not mapped.

flush.ignore();
match page_table.unmap(page) {
Ok((_frame, flush)) => flush.ignore(),
Err(UnmapError::PageNotMapped) => {} // If it wasn't mapped, that's not an issue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is similar to what we do in paging::unmap. Would it make sense to log this too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so unless you like ~510 lines of info log output on a normal boot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would not have to use info. But if you don't think a debug or trace is useful, that's fine for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't think it is worth it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a TODO into the comment or will this be tracked in an issue?

Copy link
Member Author

@jounathaen jounathaen Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is sufficient not to panic for a while, and as soon as the Uhyve version that doesn't map the memory anymore (hermit-os/uhyve@700425d btw) is out for a while, we completely remove this part. We can track it in hermit-os/uhyve#426 or create a new issue.

@mkroening mkroening enabled auto-merge December 11, 2024 12:47
@mkroening mkroening added this pull request to the merge queue Dec 11, 2024
Merged via the queue into main with commit 55b15ad Dec 11, 2024
13 checks passed
@mkroening mkroening deleted the no_unmap_error branch December 11, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Paging: Only map required areas
2 participants